home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Source Code / Visual Basic Source Code.iso / vbsource / ttedit / api.bas < prev    next >
BASIC Source File  |  1995-01-04  |  17KB  |  415 lines

  1. '
  2. '  This is a subset of WIN30API.TXT
  3. '
  4. Option Explicit
  5.  
  6. Type PointAPI
  7.     x As Integer
  8.     y As Integer
  9. End Type
  10.  
  11. Type Rect
  12.     left As Integer
  13.     top As Integer
  14.     right As Integer
  15.     bottom As Integer
  16. End Type
  17.  
  18.  
  19. Declare Function Winhelp Lib "User" (ByVal hWnd As Integer, ByVal lpHelpFile As String, ByVal wCommand As Integer, dwData As Any) As Integer
  20. Declare Function WritePrivateProfileString Lib "Kernel" (ByVal lpApplicationName As String, ByVal lpKeyName As String, ByVal lpString As String, ByVal lplFileName As String) As Integer
  21. Declare Function GetPrivateProfileInt Lib "Kernel" (ByVal lpApplicationName As String, ByVal lpKeyName As String, ByVal nDefault As Integer, ByVal lpFileName As String) As Integer
  22. Declare Function getDC Lib "User" (ByVal hWnd As Integer) As Integer
  23. Declare Function SaveDC Lib "GDI" (ByVal hDC As Integer) As Integer
  24. Declare Function RestoreDC Lib "GDI" (ByVal hDC As Integer, ByVal nSavedDC As Integer) As Integer
  25. Declare Function ReleaseDc Lib "User" (ByVal hWnd As Integer, ByVal hDC As Integer) As Integer
  26. Declare Function GetTopWindow Lib "User" (ByVal hWnd As Integer) As Integer
  27. Declare Function Getparent Lib "User" (ByVal hWnd As Integer) As Integer
  28. Declare Function CreateSolidBrush Lib "GDI" (ByVal crColor As Long) As Integer
  29. Declare Function DeleteObject Lib "GDI" (ByVal hObject As Integer) As Integer
  30. Declare Function SelectObject Lib "GDI" (ByVal hDC As Integer, ByVal hObject As Integer) As Integer
  31. Declare Function ExtFloodFill Lib "GDI" (ByVal hDC As Integer, ByVal x As Integer, ByVal y As Integer, ByVal crColor As Long, ByVal wFillType As Integer) As Integer
  32. Declare Function MoveTo Lib "GDI" (ByVal hDC As Integer, ByVal x As Integer, ByVal y As Integer) As Long
  33. Declare Function LineTo Lib "GDI" (ByVal hDC As Integer, ByVal x As Integer, ByVal y As Integer) As Integer
  34. Declare Function CreatePen Lib "GDI" (ByVal nPenStyle As Integer, ByVal nWidth As Integer, ByVal crColor As Long) As Integer
  35. Declare Function ReleaseDc Lib "User" (ByVal hWnd As Integer, ByVal hDC As Integer) As Integer
  36. Declare Function GetStockObject Lib "GDI" (ByVal nIndex As Integer) As Integer
  37. Declare Function sendMessage Lib "User" (ByVal hWnd As Integer, ByVal wMsg As Integer, ByVal wParam As Integer, lParam As Any) As Long
  38. Declare Function GetTickCount Lib "User" () As Long
  39. Declare Sub GetCursorPos Lib "User" (lpPoint As PointAPI)
  40. Declare Sub GetWindowRect Lib "User" (ByVal hWnd As Integer, lpRect As Rect)
  41. Declare Sub OffsetRect Lib "User" (lpRect As Rect, ByVal x As Integer, ByVal y As Integer)
  42. Declare Sub InflateRect Lib "User" (lpRect As Rect, ByVal x As Integer, ByVal y As Integer)
  43. Declare Sub SetWindowPos Lib "User" (ByVal hWnd As Integer, ByVal hWndInsertAfter As Integer, ByVal x As Integer, ByVal y As Integer, ByVal cx As Integer, ByVal cy As Integer, ByVal wFlags As Integer)
  44.  
  45. Global Const WM_COMMAND = &H111
  46.  
  47. ' WindowState
  48. Global Const NORMAL = 0    ' 0 - Normal
  49. Global Const MINIMIZED = 1 ' 1 - Minimized
  50. Global Const MAXIMIZED = 2 ' 2 - Maximized
  51.  
  52.  
  53. ' Key State Masks for Mouse Messages
  54. Global Const MK_LBUTTON = &H1
  55. Global Const MK_RBUTTON = &H2
  56. Global Const MK_SHIFT = &H4
  57. Global Const MK_CONTROL = &H8
  58. Global Const MK_MBUTTON = &H10
  59.  
  60.  
  61. Global Const KEY_NUMLOCK = &H90
  62. Global Const KEY_CAPITAL = &H14
  63.  
  64. ' Arrange Method
  65. ' for MDI Forms
  66. Global Const CASCADE = 0
  67. Global Const TILE_HORIZONTAL = 1
  68. Global Const TILE_VERTICAL = 2
  69. Global Const ARRANGE_ICONS = 3
  70.  
  71.  
  72. Global Const COLOR_SCROLLBAR = 0
  73. Global Const COLOR_BACKGROUND = 1
  74. Global Const COLOR_ACTIVECAPTION = 2
  75. Global Const COLOR_INACTIVECAPTION = 3
  76. Global Const COLOR_MENU = 4
  77. Global Const COLOR_WINDOW = 5
  78. Global Const COLOR_WINDOWFRAME = 6
  79. Global Const COLOR_MENUTEXT = 7
  80. Global Const COLOR_WINDOWTEXT = 8
  81. Global Const COLOR_CAPTIONTEXT = 9
  82. Global Const COLOR_ACTIVEBORDER = 10
  83. Global Const COLOR_INACTIVEBORDER = 11
  84. Global Const COLOR_APPWORKSPACE = 12
  85. Global Const COLOR_HIGHLIGHT = 13
  86. Global Const COLOR_HIGHLIGHTTEXT = 14
  87. Global Const COLOR_BTNFACE = 15
  88. Global Const COLOR_BTNSHADOW = 16
  89. Global Const COLOR_GRAYTEXT = 17
  90. Global Const COLOR_BTNTEXT = 18
  91. Global Const COLOR_ENDCOLORS = COLOR_BTNTEXT
  92. Global Const COLOR_BTNHIGHLIGHT = 20
  93.  
  94. Declare Function SetWindowlong Lib "User" (ByVal hWnd As Integer, ByVal nIndex As Integer, ByVal dwNewLong As Long) As Long
  95. Declare Function GetWindowWord Lib "User" (ByVal hWnd As Integer, ByVal nIndex As Integer) As Integer
  96. Declare Function SetWindowWord Lib "User" (ByVal hWnd As Integer, ByVal nIndex As Integer, ByVal wNewWord As Integer) As Integer
  97. Declare Function SetfocusAPI Lib "User" Alias "SetFocus" (ByVal hWnd As Integer) As Integer
  98. Declare Function GetFocus Lib "User" () As Integer
  99. Declare Function GetActiveWindow Lib "User" () As Integer
  100. Declare Function GetKeyState Lib "User" (ByVal nVirtKey As Integer) As Integer
  101. Declare Function GetAsyncKeyState Lib "User" (ByVal vKey As Integer) As Integer
  102. 'Declare Function WindowFromPoint Lib "User" (ByVal ptScreen As Any) As Integer
  103. Declare Function WindowfromPoint Lib "User" (ByVal pty As Integer, ByVal ptx As Integer) As Integer
  104. Declare Function Lstrcpy Lib "kernel" (p1 As Any, p2 As Any) As Long
  105. Declare Function ShowWindow Lib "User" (ByVal hWnd As Integer, ByVal nCmdShow As Integer) As Integer
  106. Declare Function GetSysColor Lib "User" (ByVal nIndex As Integer) As Long
  107. Declare Sub SetSysColors Lib "User" (ByVal nChanges As Integer, lpSysColor As Integer, lpColorValues As Long)
  108. Declare Function CreateCompatibleDC Lib "GDI" (ByVal hDC As Integer) As Integer
  109. Declare Function CreateCompatibleBitmap Lib "GDI" (ByVal hDC As Integer, ByVal nWidth As Integer, ByVal nHeight As Integer) As Integer
  110. Declare Function CreateBitmap Lib "GDI" (ByVal nWidth As Integer, ByVal nHeight As Integer, ByVal nPlanes As Integer, ByVal nBitCount As Integer, ByVal lpBits As Any) As Integer
  111. Declare Function BitBlt Lib "GDI" (ByVal hDestDC As Integer, ByVal x As Integer, ByVal y As Integer, ByVal nWidth As Integer, ByVal nHeight As Integer, ByVal hSrcDC As Integer, ByVal XSrc As Integer, ByVal YSrc As Integer, ByVal dwRop As Long) As Integer
  112. Declare Function PatBlt Lib "GDI" (ByVal hDC As Integer, ByVal x As Integer, ByVal y As Integer, ByVal nWidth As Integer, ByVal nHeight As Integer, ByVal dwRop As Long) As Integer
  113. Declare Function SetBkColor Lib "GDI" (ByVal hDC As Integer, ByVal crColor As Long) As Long
  114. Declare Function SetTextColor Lib "GDI" (ByVal hDC As Integer, ByVal crColor As Long) As Long
  115. Declare Function DeleteDC Lib "GDI" (ByVal hDC As Integer) As Integer
  116. Declare Function GetWindowDC Lib "User" (ByVal hWnd As Integer) As Integer
  117. Declare Function FrameRect Lib "User" (ByVal hDC As Integer, lpRect As Rect, ByVal hBrush As Integer) As Integer
  118. Declare Sub ClientToScreen Lib "User" (ByVal hWnd As Integer, lpPoint As PointAPI)
  119. Declare Sub ScreenToClient Lib "User" (ByVal hWnd As Integer, lpPoint As PointAPI)
  120. Declare Function GetSystemMetrics Lib "User" (ByVal nIndex As Integer) As Integer
  121.  
  122.  
  123. '  Ternary raster operations
  124. Global Const SRCCOPY = &HCC0020 ' (DWORD) dest = source
  125. Global Const SRCPAINT = &HEE0086        ' (DWORD) dest = source OR dest
  126. Global Const SRCAND = &H8800C6  ' (DWORD) dest = source AND dest
  127. Global Const SRCINVERT = &H660046       ' (DWORD) dest = source XOR dest
  128. Global Const SRCERASE = &H440328        ' (DWORD) dest = source AND (NOT dest )
  129. Global Const NOTSRCCOPY = &H330008      ' (DWORD) dest = (NOT source)
  130. Global Const NOTSRCERASE = &H1100A6     ' (DWORD) dest = (NOT src) AND (NOT dest)
  131. Global Const MERGECOPY = &HC000CA       ' (DWORD) dest = (source AND pattern)
  132. Global Const MERGEPAINT = &HBB0226      ' (DWORD) dest = (NOT source) OR dest
  133. Global Const PATCOPY = &HF00021 ' (DWORD) dest = pattern
  134. Global Const PATPAINT = &HFB0A09        ' (DWORD) dest = DPSnoo
  135. Global Const PATINVERT = &H5A0049       ' (DWORD) dest = pattern XOR dest
  136. Global Const DSTINVERT = &H550009       ' (DWORD) dest = (NOT dest)
  137. Global Const BLACKNESS = &H42&  ' (DWORD) dest = BLACK
  138. Global Const WHITENESS = &HFF0062       ' (DWORD) dest = WHITE
  139.  
  140. ' ShowWindow() Commands
  141. Global Const SW_HIDE = 0
  142. Glo